Fix default read of boolean opts with '1' as the default.
authorrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 3 Jan 2014 05:29:49 +0000 (05:29 +0000)
committerrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 3 Jan 2014 05:29:49 +0000 (05:29 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4708 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/gui/format.h

index 8c1dead625f3c6f6c5bdbc1978fac46f0b3f2813..65d93e6352c228b1566e9a8500f4a324dfe141da 100644 (file)
@@ -58,7 +58,13 @@ public:
       defaultValue_(defaultValue), minValue_(minValue), maxValue_(maxValue), html_(html)
   {
     value_ = QVariant();
-    isSelected_ = false;
+    // Boolean values pay more atention to 'selected' than value.  Make 
+    // them match here. For non-bools, just make them unchecked.
+    if (type_ == OPTbool && defaultValue.toBool() == true) {
+      isSelected_ = true;
+    } else {
+      isSelected_ = false;
+    }
   }
 
   FormatOption(const FormatOption & c)